<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/views/shared/taglib.jsp"%>
<%
	request.setAttribute("title", "提现");
%>
<%@ include file="/WEB-INF/views/shared/master/weContentHeader.jsp"%>
<style>
.weui-cells {
	margin-top: 0px;
}

.paytype {
	font-size: 20px;
	font-weight: 900;
	padding: 15px;
}

.rechargemoney>p {
	padding: 15px 10px;
	color: #afafaf;
	font-size: 20px;
	font-weight: 900;
}

.money {
	margin: 0px 10px;
	color: red;
}

.color-blue {
	color: #2196F3;
}

.bottom-btn {
	margin: 15px;
	padding: 10px;
	background-color: #2196F3;
}

.bottom-lab {
	position: fixed;
	bottom: 0;
	background: #fff;
	width: 100%;
	text-align: center;
	font-weight: 700;
}

.bottom-lab>div {
	margin-bottom: 15px;
}

.weui-btn_primary:not (.weui-btn_disabled ):active {
	background-color: #2196F3;
}
</style>

<%@ include file="/WEB-INF/views/shared/master/weTitle.jsp"%>
<div class="goback" data-back-href="<c:url value='/we'/>"></div>
<form id="withdraw" action="<c:url value='/we/submitAmount'/>" method="post">
	<div class="weui-cells weui-cells_form">
		<div style="width: 100%; height: 20px; background-color: #ebebeb;"></div>

		<div class="weui-cells">
			<div class="weui-cell">
				<div class="weui-cell__hd">
					<img style="width: 20px; height: 20px;" class="wealthimg"
						src="<c:url value='/images/we/myWealth/weixin.png' />">
				</div>
				<div class="weui-cell__bd">
					<p class="paytype">微信钱包</p>
				</div>
			</div>
		</div>

		<div style="width: 100%; height: 20px; background-color: #ebebeb;"></div>

		<div class="withdrawmoney">
			<p>提现金额</p>
			<div class="weui-cell">
				<div class="weui-cell__hd">
					<span style="font-size: 25px; color: #afafaf; font-weight: 500; padding-right: 10px">￥</span>
				</div>
				<div class="weui-cell__bd">
					<input class="weui-input selected-color" id="money" type="text"
						placeholder="请输入提现金额" style="font-size: 18px;" onkeyup="btnColor()">
				</div>
			</div>
			<p>
				可用余额<span class="money">0.00</span>元
			</p>
		</div>

		<div style="width: 100%; height: 20px; background-color: #ebebeb;"></div>

		<div class="bottom-lab" style="z-index: 500;">
			<a href="javascript:withdraw();"
				data-href="<c:url value='/we/personCenter/index'/>"
				class="weui-btn weui-btn_primary bottom-btn withdraw">提&nbsp;&nbsp;&nbsp;&nbsp;现</a>
		</div>
	</div>
</form>
<%@ include file="/WEB-INF/views/shared/scripts/jquery.jsp"%>
<%@ include file="/WEB-INF/views/shared/scripts/jqweui.jsp"%>
<%@ include file="/WEB-INF/views/shared/scripts/tabmob.jsp"%>

<%@ include file="/WEB-INF/views/shared/master/weContentFooter.jsp"%>

<script type="text/javascript">
	//点击提现按钮要执行的操作
	function withdraw() {
		if(!checkInput()){
			return;
		}
			
		var formData = $("#withdraw").serialize();
		var action = $("#withdraw").attr("action");
		var result = $.getTextPost(action,formData);
		if(result=="true"){
			$.toast("申请提现成功");
			setTimeout(function(){
			window.location.href = href;
			},500);
		}else{
			$.toast("申请提现失败","forbidden");
		}
	}
	/* 检查输入 */
	function checkInput(){
		if(checkMoney()){
			return true;
		}
		return false;
	}
	/* 检查是否输入金额 */
	function checkMoney(){
		var money = $("#money").val();
		if($.isNull(money)){
			$.toptip("请输入金额","error");
			return false;
		}
		return true;
	}
</script>